/**
*  Copyright (c) 2011, Alex Theodoridis
*  All rights reserved.

*  Redistribution and use in source and binary forms, with
*  or without modification, are permitted provided that the
*  following conditions are met:
*  Redistributions of source code must retain the above
*  copyright notice, this list of conditions and the following disclaimer.
*  Redistributions in binary form must reproduce the above
*  copyright notice, this list of conditions and the following
*  disclaimer in the documentation and/or other materials
*  provided with the distribution.

*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
*  AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
*  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
*  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
*  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
*  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
*  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
*  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
*  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
*  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
*  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
*  ANY WAY OUT OF THE USE OF THIS SOFTWARE,
*  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
*/

#ifndef NeuronInputH
#define NeuronInputH

namespace nn {

    /**
     * Class NeuronInput
     * Represent the input of neuron.
     * Contains a pair of values input and input weight.
     */
    template<class Var>
    class NeuronInput {
    private:
        /**
         * Input weight value.
         */
        Var _inputWeight;

        /**
         * Input value.
         */
        Var _value;

    public:

        /**
        * Empty constructor will
        * initialize the object.
        */
        NeuronInput() {
            _value = Var ( );
            _inputWeight = Var ();
        }

        /**
         * Initialization constructor.
         * @param input the inputValue.
         * @param inputWeight inputs weight value.
         */
        NeuronInput ( const Var& value, const Var& inputWeight ) {
            _value = value;
            _inputWeight = inputWeight;
        }

        /**
         * Will compare inputs value.
         * @param input.
         */
        bool operator != ( const NeuronInput<Var>& input ) const {
            return ( input._inputWeight != _inputWeight || input._value != _value );
        }

        /**
         * Will compare inputs value.
         * @param input.
         */
        bool operator == ( const NeuronInput<Var>& input ) const {
            return ( input._inputWeight == _inputWeight && input._value == _value );
        }

        /**
         * Will return the weight of current input.
         * @returns the input weight value.
         */
        const Var& getInputWeight ( void ) const {
            return _inputWeight;
        }

        /**
         * Will return the input value.
         * @returns the input value.
         */
        const Var& getValue ( void ) const {
            return _value;
        }

        /**
         * Will set the inputs value.
         * @param input value.
         */
        void setValue ( const Var& value ) {
            _value = value;
        }

        /**
         * Will set the input weight value.
         * @param inputWeight new weight value.
         */
        void setInputWeight ( const Var& inputWeight ) {
            _inputWeight = inputWeight;
        }

        /**
         * Destructor.
         */
        virtual ~NeuronInput() throw () {
        }
    };

}

#endif
// kate: indent-mode cstyle; space-indent on; indent-width 4; 
